package com.docker.sys.app;

import com.docker.core.constant.MainConstant;
import com.docker.core.mvc.dao.BaseDao;
import com.jfinal.kit.Okv;
import com.jfinal.plugin.activerecord.Record;

import java.util.List;

/**
 * @Author ldl
 * @Create 2020/09/18 018 14:18
 */
public class AppDao extends BaseDao {

    @Override
    protected String getDbName() {
        return MainConstant.DB_DOCKER;
    }

    @Override
    protected String getSqlTplNameSpace() {
        return "sys.app";
    }

    public List<Record> look(Okv cond) {
        return tplSPList("look", cond);
    }

    public boolean save(Record app) {
        return save("sys_app_info", "app_id", app);
    }

    public Record info(String appId) {
        return info("sys_app_info", "app_id", appId);
    }

    public boolean update(Record app) {
        return update("sys_app_info", "app_id", app);
    }

    public Record secter(String appId) {
        return tplInfo("secret", appId);
    }

    public List<Record> list(Okv cond) {
        return tplSPList("list.normal", cond);
    }

}
